class Events{
    list=[]
    $emit(...reset){
        let EventName = reset.shift()
        let CallBacks = this.list[EventName]
        if(!CallBacks || !CallBacks.length) return;
        CallBacks.map(cbk=>{
            cbk(reset)
        })
    }
    $on( EventName,CallBack ){
        if( !this.list[EventName] ){
            this.list[EventName] = []
        }
        this.list[EventName].push(CallBack)
    }
}
export default new Events